home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / misc / emu / arosdev.lha / AROS / rom / utility / getuniqueid.c < prev    next >
C/C++ Source or Header  |  1997-01-27  |  2KB  |  82 lines

  1. /*
  2.     (C) 1995 AROS - The Amiga Replacement OS
  3.     $Id: getuniqueid.c,v 1.7 1997/01/27 13:17:14 digulla Exp $
  4.     $Log: getuniqueid.c,v $
  5.     Revision 1.7  1997/01/27 13:17:14  digulla
  6.     Added #include <proto/exec.h>
  7.  
  8.     Revision 1.6  1997/01/27 00:32:31  ldp
  9.     Polish
  10.  
  11.     Revision 1.5  1996/12/10 14:00:14  aros
  12.     Moved #include into first column to allow makedepend to see it.
  13.  
  14.     Revision 1.4  1996/10/24 15:51:36  aros
  15.     Use the official AROS macros over the __AROS versions.
  16.  
  17.     Revision 1.3  1996/09/12 14:52:47  digulla
  18.     Better way to separate public and private parts of the library base
  19.  
  20.     Revision 1.2  1996/08/31 12:58:12  aros
  21.     Merged in/modified for FreeBSD.
  22.  
  23.     Desc:
  24.     Lang: english
  25. */
  26. #include <proto/exec.h>
  27. #include "utility_intern.h"
  28.  
  29. /*****************************************************************************
  30.  
  31.     NAME */
  32. #include <proto/utility.h>
  33.  
  34.     AROS_LH0(ULONG, GetUniqueID,
  35.  
  36. /*  SYNOPSIS */
  37.     /* void */
  38.  
  39. /*  LOCATION */
  40.     struct UtilityBase *, UtilityBase, 45, Utility)
  41.  
  42. /*  FUNCTION
  43.     Returns a unique id that is different from any other id that is
  44.     obtained from this function call.
  45.  
  46.     INPUTS
  47.  
  48.     RESULT
  49.     an unsigned long id
  50.  
  51.     NOTES
  52.  
  53.     EXAMPLE
  54.  
  55.     BUGS
  56.  
  57.     SEE ALSO
  58.  
  59.     INTERNALS
  60.     Calls Disable()/Enable() to guarentee uniqueness.
  61.  
  62.     HISTORY
  63.     29-10-95    digulla automatically created from
  64.                 utility_lib.fd and clib/utility_protos.h
  65.     17-08-96    iaint   Reimplemented. CVS lost my old one. Well I did.
  66.  
  67. *****************************************************************************/
  68. {
  69.     AROS_LIBFUNC_INIT
  70.     ULONG ret;
  71.  
  72.     Disable();
  73.  
  74.     ret = ++(GetIntUtilityBase(UtilityBase)->ub_LastID);
  75.  
  76.     Enable();
  77.  
  78.     return ret;
  79.  
  80.     AROS_LIBFUNC_EXIT
  81. } /* GetUniqueID */
  82.